//
// CTextureGrouped.java
// Copyright (C) 2010  "Naush" <naush _ hotmail _ fr>
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Affero General Public License as
// published by the Free Software Foundation, either version 3 of the
// License, or (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
// GNU Affero General Public License for more details.
//
// You should have received a copy of the GNU Affero General Public License
// along with this program.  If not, see <http://www.gnu.org/licenses/>./* ----------------------------------------------------------------------------







package org.ryzom.nel.threed;

import org.ryzom.nel.misc.CUV;
import org.ryzom.nel.misc.IStream;

public class CTextureGrouped extends ITexture {
  private long swigCPtr;

  public CTextureGrouped(long cPtr, boolean cMemoryOwn) {
    super(nel3dJNI.CTextureGrouped_SWIGUpcast(cPtr), cMemoryOwn);
    swigCPtr = cPtr;
  }

  public static long getCPtr(CTextureGrouped obj) {
    return (obj == null) ? 0 : obj.swigCPtr;
  }

  protected void finalize() {
    delete();
  }

  public synchronized void delete() {
    if (swigCPtr != 0) {
      if (swigCMemOwn) {
        swigCMemOwn = false;
        nel3dJNI.delete_CTextureGrouped(swigCPtr);
      }
      swigCPtr = 0;
    }
    super.delete();
  }

  public CTextureGrouped() {
    this(nel3dJNI.new_CTextureGrouped__SWIG_0(), true);
  }

  public CTextureGrouped(CTextureGrouped src) {
    this(nel3dJNI.new_CTextureGrouped__SWIG_1(CTextureGrouped.getCPtr(src), src), true);
  }

  public CTextureGrouped assign(CTextureGrouped src) {
    return new CTextureGrouped(nel3dJNI.CTextureGrouped_assign(swigCPtr, this, CTextureGrouped.getCPtr(src), src), false);
  }

  public boolean areValid(SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t textureTab, long nbTex) {
    return nel3dJNI.CTextureGrouped_areValid(swigCPtr, this, SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t.getCPtr(textureTab), nbTex);
  }

  public void setTextures(SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t textureTab, long nbTex, boolean checkValid) {
    nel3dJNI.CTextureGrouped_setTextures__SWIG_0(swigCPtr, this, SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t.getCPtr(textureTab), nbTex, checkValid);
  }

  public void setTextures(SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t textureTab, long nbTex) {
    nel3dJNI.CTextureGrouped_setTextures__SWIG_1(swigCPtr, this, SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t.getCPtr(textureTab), nbTex);
  }

  public long getNbTextures() {
    return nel3dJNI.CTextureGrouped_getNbTextures(swigCPtr, this);
  }

  public void getTextures(SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t textureTab) {
    nel3dJNI.CTextureGrouped_getTextures(swigCPtr, this, SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t.getCPtr(textureTab));
  }

  public SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t getTexture(long index) {
    return new SWIGTYPE_p_CSmartPtrT_NL3D__ITexture_t(nel3dJNI.CTextureGrouped_getTexture(swigCPtr, this, index), true);
  }

  public CUV getUVDelta() {
    return new CUV(nel3dJNI.CTextureGrouped_getUVDelta(swigCPtr, this), false);
  }

  public CUV getUV(long index) {
    return new CUV(nel3dJNI.CTextureGrouped_getUV(swigCPtr, this, index), false);
  }

  public boolean supportSharing() {
    return nel3dJNI.CTextureGrouped_supportSharing(swigCPtr, this);
  }

  public String getShareName() {
    return nel3dJNI.CTextureGrouped_getShareName(swigCPtr, this);
  }

  public void doGenerate(boolean async) {
    nel3dJNI.CTextureGrouped_doGenerate__SWIG_0(swigCPtr, this, async);
  }

  public void doGenerate() {
    nel3dJNI.CTextureGrouped_doGenerate__SWIG_1(swigCPtr, this);
  }

  public void serial(IStream f) {
    nel3dJNI.CTextureGrouped_serial(swigCPtr, this, IStream.getCPtr(f), f);
  }

  public SWIGTYPE_p_NL3D__CTextureGrouped__TFourUV getUVQuad(long texIndex) {
    return new SWIGTYPE_p_NL3D__CTextureGrouped__TFourUV(nel3dJNI.CTextureGrouped_getUVQuad(swigCPtr, this, texIndex), false);
  }

  public void release() {
    nel3dJNI.CTextureGrouped_release(swigCPtr, this);
  }

}
